﻿<controls:ChildWindow x:Class="LEEAAttendanceControl.Views.TodayAbsence"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
           xmlns:my="clr-namespace:LEEAAttendanceControl.Web.Services"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="470" Height="400" 
           Title="Today Absence">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Vertical" Grid.Row="0">
            <riaControls:DomainDataSource x:Name="EmployeesDataSource" AutoLoad="True" QueryName="GetLateEmployees">
                <riaControls:DomainDataSource.DomainContext>
                    <my:LEEAContext />
                </riaControls:DomainDataSource.DomainContext>
            </riaControls:DomainDataSource>

            <sdk:DataGrid x:Name="EmployeesGrid" AutoGenerateColumns="False" IsReadOnly="True" MaxHeight="324"
                      VerticalScrollBarVisibility="Visible"
                      ItemsSource="{Binding Data, ElementName=EmployeesDataSource}">
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTemplateColumn Header="First Name" IsReadOnly="True" Width="145">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <sdk:Label Content="{Binding FirstName}" HorizontalAlignment="Left" VerticalAlignment="Center"
                                       Margin="5,2,2,2" Height="23"/>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                    <sdk:DataGridTemplateColumn Header="Last Name" IsReadOnly="True" Width="145">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <sdk:Label Content="{Binding LastName}" HorizontalAlignment="Left" VerticalAlignment="Center"
                                       Margin="5,2,2,2" Height="24"/>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                    <sdk:DataGridTemplateColumn Header="Department" IsReadOnly="True" Width="139">
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <sdk:Label Content="{Binding Department.DepartmentName}" HorizontalAlignment="Left" VerticalAlignment="Center"
                                       Margin="5,2,2,2" Height="24"/>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>
        </StackPanel>

        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="25" HorizontalAlignment="Right"
                Margin="0,10,0,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>